#!/bin/bash

if [ ! $1 ]; then
KEXT="./build/Debug/XBox360Wireless.kext"
else
KEXT=$1
fi
TESTKEXT=$(dirname $KEXT)/_test_$(basename $KEXT)

kextunload -v $TESTKEXT
sleep 1
rm -r $TESTKEXT
cp -R $KEXT $TESTKEXT
chown -R root:wheel $TESTKEXT
kextload -tv $TESTKEXT
